#include<iostream>
using namespace std;
int accumulation(int *array,int arrlen)
{
	if(arrlen==0)
	{
		return 0;
	}
	if(arrlen==1)
	{
		return array[0];
	}
	
	return array[0]+accumulation(array+1,arrlen-1);
} 
int main()
{
	int array[]={1,2,3,4,5,6,7,8,9};
	int arrlen=sizeof(array)/sizeof(int);
	
	cout<<accumulation(array,arrlen)<<endl;
}
